package com.inkegz.message.repo.base

import androidx.lifecycle.LiveData
import com.inkegz.message.entity.ConversationEntity
import com.inkegz.message.entity.MessageEntity


interface ConversationRepo{

    fun conversations(): LiveData<List<ConversationEntity>>

    fun getConversationVersionId(selector: (ConversationEntity) -> Long = {conversation -> conversation.versionId}): Long

    fun putConversations(vararg conversationArray: ConversationEntity)
}

interface MessageRepo{

    fun messages(conversationKey: String): LiveData<List<MessageEntity>>

    fun getMessageVersionId(conversationKey: String, isMax: Boolean = false, selector: (MessageEntity) -> Long = {message -> message.versionId}): Long

    fun putMessages(conversationKey: String, vararg messageArray: MessageEntity)
}

